Fix for hanging when run in an off-line environment #183
Fix for hanging when run in an off-line environment #183jason-weirather wants to merge 11 commits intoComfy-Org:mainfrom
Conversation
… set optionally. added PEP 585 type hints to functions in module.
comfy_cli/update.py
Outdated
| return False, current_version | ||
| except requests.RequestException: | ||
| # print(f"Error checking latest version: {e}") | ||
| # Fail quietly on timeout or any request exception |
There was a problem hiding this comment.
| # Fail quietly on timeout or any request exception | |
| print(f"Warning: unable to fetch {package_name} version metadata from Pypi. Retaining current version {current_version}") |
There was a problem hiding this comment.
probably shouldn't fail silently
|
Overall LGTM! Just one small nit with emitting a warning instead of failing silently on pypi request timeout/failure |
…g default settings this warning should be displayed
…he fully offline mode since its getting hit dispite disabiling tracking
…stants to a string which is assumed to a bool causing it to always evaluate to true
…uration, so don't cast to a bool when checking that
|
@telamonian Thank you for you for the review, I noticed the package does have a logging module so I have propose a change that uses that. While testing, I ran into another hang in my testing environment that I think uncovered a bug and try to address that. Summary of Changes:
Apologies for the 11 commits, I kept thinking I had this sorted then found a little more thread. |
|
@jason-weirather Hello, if you want you can rebase this and we will continue with the teat/merge process. |
|
Thanks for flagging this issue and putting together a fix! The offline hang was a real problem. Since this PR has been open for a while and the config_manager/tracking parts have been addressed separately, I've put up #378 with just the timeout fix (5s on the PyPI check + tests). Kept it minimal. Really appreciate you digging into this - especially the Docker testing that uncovered the tracking bool bug. Closing in favor of #378 |
Proposed fix for the issue where running in an off-line environment hangs on check_for_updates.
Adds a default 10 second timeout to the request
Shortened to 3 second timeout in the launcher and env command calls where check_for_updates is not a requirement.
Consistent with the previous request code, if it times out it will fail quietly and return false and the current version.
Issue being addressed:
#175
Also added PEP 585 type hints to functions in the updates module.